<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAddressTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('address', function (Blueprint $table) {
            $table->increments('id');
            $table->string('address', 255);
            $table->char('phone', 11);
            $table->string('link_man');
            $table->integer('uid')->index();
            $table->char('code', 6);
            $table->tinyInteger('state')->comment('0:默认收货地址, 1:非默认收货地址');
            $table->string('attr1', 50)->nullable();
            $table->string('attr2', 100)->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('address');
    }
}
